exports.parseUrl = function(t) {
    var e = t.slice(t.indexOf("?") + 1).split("&"), r = e.length > 0 ? {} : null;
    return e.map(function(t) {
        var e = t.split("=");
        r[e[0]] = e[1];
    }), r;
}, exports.parseTag = function(t, e, r) {
    var a = [];
    a.push({
        tag: !1,
        text: ""
    });
    for (var n = 0; n < t.length; n++) t.charAt(n) == e ? a.push({
        tag: !0,
        text: ""
    }) : t.charAt(n) == r ? a.push({
        tag: !1,
        text: ""
    }) : a[a.length - 1].text += t.charAt(n);
    return a;
}, exports.parseTag2 = function(t, e, r) {
    var a = [];
    a.push({
        tag: !1,
        text: ""
    });
    for (var n = 0; n < t.length; n++) if (t.charAt(n) == e) a.push({
        tag: !0,
        enter: !1,
        text: ""
    }); else if (t.charAt(n) == r) a.push({
        tag: !1,
        enter: !1,
        text: ""
    }); else if ("\n" == t.charAt(n)) {
        var s = a[a.length - 1].tag;
        a.push({
            tag: s,
            enter: !0,
            text: t.charAt(n)
        }), a.push({
            tag: s,
            enter: !1,
            text: ""
        });
    } else a[a.length - 1].text += t.charAt(n);
    return a;
}, exports.toRichNodes = function(t, e, r) {
    var a = [];
    return t.map(function(t) {
        t.enter ? a.push({
            type: "node",
            name: "br"
        }) : a.push({
            type: "node",
            name: "span",
            attrs: {
                class: t.tag ? r : e
            },
            children: [ {
                type: "text",
                text: t.text
            } ]
        });
    }), a;
};